package com.blb.controller;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @RestController  声明该类是一个Controller
 */
@RestController
@RequestMapping("demo")
public class Demo1Controller {

    /**
     * @GetMapping  路径映射
     * @return
     */
    @GetMapping("hello")
    public String hello(){
        return "hello springmvc";
    }

    @RequestMapping("hello2")
    public String hello2(){
        return "test hello2";
    }
}
